cmake_minimum_required(VERSION 3.10)
project(ChatServer)

set(CMAKE_CXX_STANDARD 11)

# 添加头文件搜索路径
include_directories(common)
include_directories(src/server)
include_directories(src/client)

# 服务器可执行文件
add_executable(chat_server 
    src/server/server.cpp 
    src/server/client_handler.cpp
)

# 客户端可执行文件
add_executable(chat_client 
    src/client/client.cpp
)

# 链接pthread库
target_link_libraries(chat_server pthread)
target_link_libraries(chat_client pthread)    